﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using AncientLand.Service;
using AncientLand.Service.Entity;
using AncientLand.Service.IDa;

namespace AncientLand.Da
{
    public class DatabaseFactory : Disposable, IDatabaseFactory
    {
        private SiteDb _dataContext;
        public SiteDb Get()
        {
            return _dataContext ?? (_dataContext = new SiteDb());
        }
        protected override void DisposeCore()
        {
            if (_dataContext != null)
                _dataContext.Dispose();
        }
    }
}
